package com.atomos.strategy.action.velocity
{
	import com.atomos.particle.Particle;
	import com.atomos.strategy.action.AbstractAction;
	import com.atomos.strategy.action.ActionStrategy;
	import com.atomos.utils.PointUtils;	

	public class FrictionAction extends AbstractAction implements ActionStrategy
	{
		protected var _nFriction : Number;
		
		public function FrictionAction ( friction : Number )
		{
			setFriction( friction );
		}
		public override function process(particle:Particle):void
		{
			PointUtils.scale( particle.velocity, _nFriction );
		}
		
		public function setFriction( friction : Number ) : void
		{
			_nFriction = isNaN( friction ) ? 1 : friction
		}
		
		public function getFriction () : Number
		{
			return _nFriction;
		}
	}
}